import type { Order } from '@/types/api'

interface FetchTakedOrdersAPIResData {
  code: number
  msg: string
  time: string
  data: Order[]
}

interface FetchTakedOrdersAPIParams {
  lat: string
  lng: string
  type: string
  driver_status: string
}

export function fetchTakedOrdersAPI(params: FetchTakedOrdersAPIParams, token: string) {
  return httpInstance.get<FetchTakedOrdersAPIResData, FetchTakedOrdersAPIParams>(
    '/api/driver/jdList',
    { params, headers: { token } },
  )
}
